<template>
  <div class="home-container">
    <h1 class="title">AI 射覆</h1>

    <div class="start-card">
      <a-button
        type="primary"
        size="large"
        class="start-button"
        @click="startGame"
      >
        点击开始
      </a-button>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const startGame = () => {
  // 生成随机房间号
  const roomId = Math.floor(Math.random() * 1000000)
  router.push(`/chat/${roomId}`)
}
</script>

<style scoped>
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
}

.title {
  font-size: 42px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 40px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.start-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  text-align: center;
  max-width: 500px;
  width: 100%;
}

.start-button {
  width: 200px;
  height: 60px;
  font-size: 18px;
  border-radius: 12px;
}
</style>
